package com.dlut.java;

import java.util.Arrays;
import java.util.Scanner;
import java.util.Scanner.*;
public class RedBook2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextInt();
        }
        Arrays.sort(nums);
        int count = 0;
        if (nums[n-1] >= 7){
            count += nums[n-1] - 7;
            int sel0 = sel(nums, 0);
            if (sel0%2 == 0){
                for (int i = 0; i < sel0; i++) {
                    count += -1 - nums[i];
                }
                for (int i = sel0; i < n - 1; i++) {
                    count += Math.abs(nums[i] - 1);
                }
                System.out.println(count);
                return;
            }else{
                for (int i = 0; i < sel0 - 1; i++) {
                    count += -1 - nums[i];
                }
                for (int i = sel0 + 1; i < n - 1; i++) {
                    count += Math.abs(nums[i] - 1);
                }
                count += Math.min(Math.abs(nums[sel0] - 1) + Math.abs(nums[sel0-1] - 1) , Math.abs(nums[sel0] + 1) + Math.abs(nums[sel0-1] + 1)) ;
                System.out.println(count);
                return;
            }
        }else if(nums[0] <= -7){
            count += -7 -nums[0] ;
            int sel0 = sel(nums, 0);
            if (sel0%2 == 0){
                for (int i = 1; i < sel0; i++) {
                    count += -1 - nums[i];
                }
                for (int i = sel0; i < n; i++) {
                    count += Math.abs(nums[i] - 1);
                }
                System.out.println(count);
                return;
            }else if (sel0 == 1){
                for (int i = 2; i < n; i++) {
                    count += Math.abs(nums[i] - 1);
                }
                count += nums[1] + 1;
                int count1 = 0;
                for (int i = 0; i < n-1; i++) {
                    count1 += Math.abs(nums[i] - 1);
                }
                count1+= Math.abs(nums[n-1] - 7);
                System.out.println(Math.min(count,count1));

            }
            else{
                for (int i = 1; i < sel0 - 1; i++) {
                    count += -1 - nums[i];
                }
                for (int i = sel0 + 1; i < n; i++) {
                    count += Math.abs(nums[i] - 1);
                }
                count += Math.min(Math.abs(nums[sel0] - 1) + Math.abs(nums[sel0-1] - 1) , Math.abs(nums[sel0] + 1) + Math.abs(nums[sel0-1] + 1)) ;
                System.out.println(count);
                return;
            }
        }
        else if (nums[n-1] + nums[0] >= 0){
            count += 7 - nums[n-1];
            int sel0 = sel(nums, 0);
            if (sel0%2 == 0){
                for (int i = 0; i < sel0; i++) {
                    count += -1 - nums[i];
                }
                for (int i = sel0; i < n - 1; i++) {
                    count += Math.abs(nums[i] - 1);
                }
                System.out.println(count);
                return;
            }else{
                for (int i = 0; i < sel0 - 1; i++) {
                    count += -1 - nums[i];
                }
                for (int i = sel0 + 1; i < n - 1; i++) {
                    count += Math.abs(nums[i] - 1);
                }
                count += Math.min(Math.abs(nums[sel0] - 1) + Math.abs(nums[sel0-1] - 1) , Math.abs(nums[sel0] + 1) + Math.abs(nums[sel0-1] + 1)) ;
                System.out.println(count);
                return;
            }
        }
        else{
            count += 7 + nums[0];
            int sel0 = sel(nums, 0);
            if (sel0%2 == 0){
                for (int i = 1; i < sel0; i++) {
                    count += -1 - nums[i];
                }
                for (int i = sel0; i < n; i++) {
                    count += Math.abs(nums[i] - 1);
                }
                System.out.println(count);
                return;
            }
            else if (sel0 == 1){
                for (int i = 2; i < n; i++) {
                    count += Math.abs(nums[i] - 1);
                }
                count += nums[1] + 1;
                System.out.println(count);
                return;
            }
            else{
                for (int i = 1; i < sel0 - 1; i++) {
                    count += -1 - nums[i];
                }
                for (int i = sel0 + 1; i < n; i++) {
                    count += Math.abs(nums[i] - 1);
                }
                count += Math.min(Math.abs(nums[sel0] - 1) + Math.abs(nums[sel0-1] - 1) , Math.abs(nums[sel0] + 1) + Math.abs(nums[sel0-1] + 1)) ;
                System.out.println(count);
                return;
            }
        }




    }
    public static int sel(int[] nums, int k){
        //第一个大于等于k的数的位置
        int n = nums.length;
        int l = 0, r = n - 1;
        int mid = 0;
        while (l <= r){
            mid = l + (r - l) / 2;
            if (nums[mid] < k){
                l = mid + 1;
            }else{
                r = mid - 1;
            }
        }
        return l;
    }
}
